package com.mall.system.service;

import com.mall.common.core.text.Convert;
import com.mall.system.domain.entity.SysOperLog;
import com.mall.system.mapper.SysOperLogMapper;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 操作日志 服务层处理
 * Created by zhonglin on 2020/4/8.
 */
@Service
public class SysOperLogService {

  @Autowired
  private SysOperLogMapper operLogMapper;

  /**
   * 新增操作日志
   *
   * @param operLog 操作日志对象
   */
  public void insertOperlog(SysOperLog operLog) {

    operLogMapper.insertOperlog(operLog);
  }

  /**
   * 查询系统操作日志集合
   *
   * @param operLog 操作日志对象
   *
   * @return 操作日志集合
   */
  public List<SysOperLog> selectOperLogList(SysOperLog operLog) {

    return operLogMapper.selectOperLogList(operLog);
  }

  /**
   * 批量删除系统操作日志
   *
   * @param ids 需要删除的数据
   *
   * @return
   */
  public int deleteOperLogByIds(String ids) {

    return operLogMapper.deleteOperLogByIds(Convert.toStrArray(ids));
  }

  /**
   * 查询操作日志详细
   *
   * @param operId 操作ID
   *
   * @return 操作日志对象
   */
  public SysOperLog selectOperLogById(Long operId) {

    return operLogMapper.selectOperLogById(operId);
  }

  /**
   * 清空操作日志
   */
  public void cleanOperLog() {

    operLogMapper.cleanOperLog();
  }

}
